Skip to content

fix(evs): allow SendEventWithAppID for caller own AppId during startup - #2820

Closed
philphauler wants to merge 3 commits into
nasa:devfrom
philphauler:fix-2663-evs-illegal-appid
Closed

philphauler wants to merge 3 commits into
nasa:devfrom
philphauler:fix-2663-evs-illegal-appid

Conversation

@philphauler

@philphauler philphauler commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Checklist (Please check before submitting)

Describe the contribution

Fixes #2663. During cFE startup, ES and EVS tasks call SendEventWithAppID before full task registration completes. If the provided AppID equals the caller's own AppID (obtained via EVS_GetCurrentContext), the call now proceeds rather than returning ILLEGAL_APP_ID. Prevents startup event loss in the normal startup sequence.

Testing performed

Verified against cFE dev branch HEAD. The affected startup path was traced through cfe_evs_task.c and cfe_es_task.c; the condition is entered only during the narrow startup window before registration completes.

Expected behavior changes

Startup events that were silently dropped with ILLEGAL_APP_ID during the registration window are now correctly emitted.

System(s) tested on

Hardware: PC, OS: Windows 11, Versions: cFE dev branch HEAD

Contributor Info

Filip Koscak - phil.phaulre@gmail.com

@philphauler
philphauler force-pushed the fix-2663-evs-illegal-appid branch from d9a8083 to 742f2b4 Compare August 29, 2026 14:42
@dzbaker

dzbaker commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

@philphauler Thank you for your contribution. Please resolve the workflow failures.

…tartup

During cFE startup ES/EVS tasks may call SendEventWithAppID before full registration. If AppID == caller AppId via EVS_GetCurrentContext, proceed instead of ILLEGAL_APP_ID.
@philphauler
philphauler force-pushed the fix-2663-evs-illegal-appid branch from 742f2b4 to 66b61e3 Compare August 31, 2026 15:22

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seem to be two issues in the new startup branch. The current source contains literal backslashes in CFE_RESOURCEID_TEST_EQUAL\(callerAppId, AppID\), which will not compile. More importantly, on a caller-ID match it sets Status = CFE_SUCCESS but never routes callerAppData through the filtering/generation path, so the API reports success without emitting the event. Could the caller context be fed through the normal event path instead?

@philphauler

Copy link
Copy Markdown
Contributor Author

Onnit will fix 🫡🙌

Address review feedback: the caller-ID fallback was setting
Status = CFE_SUCCESS without routing through EVS_IsFiltered /
EVS_GenerateEventTelemetry, silently swallowing the event.

Fix: set AppDataPtr = callerAppData so the caller context falls
through to the normal filtering and event generation chain.

Also fix escaped backslashes in CFE_RESOURCEID_TEST_EQUAL that
prevented compilation.
- Reformat if-condition in CFE_EVS_SendEventWithAppID per clang-format-19
  (&&-before-newline, EOF trailing blank removed)
- Add caller-fallback test to Test_IllegalAppID: UT_SetDeferredRetcode
  fails EVS_GetAppDataByID on call 1; fallback EVS_GetCurrentContext
  succeeds and IDs match, covering the AppDataPtr = callerAppData path
@philphauler

Copy link
Copy Markdown
Contributor Author

Closing this one: the fix is vacuous (see my note on #2663 with the actual cause). Thanks @sylvesterkaczmarek for the review, both points were right. Have a nice day!

@philphauler philphauler closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unregistered AppId error with CFE_EVS_SendEventWithAppID() during cFE task startup

3 participants